﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Text;
using System.IO;
using System.Xml;
using System.Data;
using Gift.WebApp;

using Gift.DAL;
using Gift.Model;

public partial class cn_member_center_expense_records : System.Web.UI.Page
{
    // Fields
    readonly DALExpenseRecords theExpenseRecords = new DALExpenseRecords();

    // Methods
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HttpContext.Current.Session["user"] == null)
        {
            base.Response.Redirect("/cn/web_login.html?ru=" + HttpContext.Current.Request.Url.PathAndQuery.Replace("aspx", "html"));
        }
        if (!base.IsPostBack)
        {
            this.rptExpenseRecordsBind();
        }
    }

    private void rptExpenseRecordsBind()
    {
        try
        {
            if (this.Session["user"] != null)
            {
                this.rptExpenseRecords.DataSource = this.theExpenseRecords.GetExpenseRecordsByUser((this.Session["user"] as tbUser).id).DefaultView;
                this.rptExpenseRecords.DataBind();
            }
        }
        catch
        {
        }
    }

}